package com.zyf.chapter01.principle.SOLID.OCP.handler;

import com.zyf.chapter01.principle.SOLID.OCP.AlertRule;
import com.zyf.chapter01.principle.SOLID.OCP.ApiStatInfo;
import com.zyf.chapter01.principle.SOLID.OCP.Notification;

/**
 * 告警处理抽象类
 * @author yifeng
 */
public abstract class AlertHandler {
    protected AlertRule rule;
    protected Notification notification;

    public AlertHandler(AlertRule rule, Notification notification) {
        this.rule = rule;
        this.notification = notification;
    }

    // 抽象特性，子类实现自己的逻辑
    public abstract void check(ApiStatInfo apiStatInfo);
}
